@echo off
set "CHROME_USER_DIR=D:\GoogleChromeData\Default"

echo 正在强制关闭 Chrome 进程...
taskkill /F /IM chrome.exe /T >nul 2>&1

echo 正在清理网页痕迹...

:: 1. 清理浏览历史和链接记录
del /q /f "%CHROME_USER_DIR%\History" >nul 2>&1
del /q /f "%CHROME_USER_DIR%\History-journal" >nul 2>&1
del /q /f "%CHROME_USER_DIR%\Visited Links" >nul 2>&1

:: 2. 清理搜索记录、自动填表、信用卡信息
del /q /f "%CHROME_USER_DIR%\Web Data" >nul 2>&1
del /q /f "%CHROME_USER_DIR%\Web Data-journal" >nul 2>&1

:: 3. 清理所有网站的本地存储和 Cookie 
rd /s /q "%CHROME_USER_DIR%\Cookies" >nul 2>&1
rd /s /q "%CHROME_USER_DIR%\Local Storage" >nul 2>&1
rd /s /q "%CHROME_USER_DIR%\IndexedDB" >nul 2>&1
rd /s /q "%CHROME_USER_DIR%\Session Storage" >nul 2>&1

:: 4. 清理大体积缓存
rd /s /q "%CHROME_USER_DIR%\Cache" >nul 2>&1
rd /s /q "%CHROME_USER_DIR%\Code Cache" >nul 2>&1
rd /s /q "%CHROME_USER_DIR%\GPUCache" >nul 2>&1

echo 清理完成！正在启动 Chrome...
start "" "C:\Program Files\Google\Chrome\Application\chrome.exe"

exit